# -*- coding:utf-8 -*-
"""
Created on 2009-10-28

@author: Qiu wenfeng
"""
import scipy

def dirac(x, sigma):
    '''
    the following functions are called by the main function EVOLUTION
    '''
    f = (1./2./sigma)*(1+scipy.cos(scipy.pi*x/sigma))
    b = scipy.logical_and(x<=sigma,x>=-sigma)
    f = f*b
    return f